package com.cn.longdistancebusstation.scenic.order;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.cn.longdistancebusstation.R;
import com.cn.longdistancebusstation.base.BaseActivity;

/**
 * Created by mucheng on 2018/5/4.
 */

public class MemoActivity extends BaseActivity implements View.OnClickListener{
    private EditText mMemoEditText;
    private Button mPreserveButton;
    private String memoDetails;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_memo);
        this.getTitleTextView().setText("备注");
        initView();
    }

    private void initView() {
        Intent intent=getIntent();
        memoDetails=intent.getStringExtra("memoDetails");
        mMemoEditText=(EditText)findViewById(R.id.edit_content);
        mMemoEditText.setOnClickListener(this);
        mMemoEditText.setText(memoDetails);
        mPreserveButton=(Button)findViewById(R.id.btn_sure_memo);
        mPreserveButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch(view.getId()){
            case R.id.btn_sure_memo:
                Intent in=new Intent(MemoActivity.this,SubmitOrderActivity.class);
                in.putExtra("memo",mMemoEditText.getText().toString());
                setResult(RESULT_OK,in);
                finish();
                break;
        }

    }
}
